<!DOCTYPE html>
<html>
  <head>
    <title>满福堂</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
      <link rel="stylesheet" href="${s.base}/mobile/base/css/weui.min.css">
      <link rel="stylesheet" href="${s.base}/mobile/base/css/jquery-weui.css">
      <link rel="stylesheet" href="${s.base}/mobile/wechat/css/base.css">
      <link rel="stylesheet" href="${s.base}/mobile/wechat/css/index.css">
      <link rel="stylesheet" href="${s.base}/mobile/wechat/css/component.css">
  </head>
  <body>
  <div class="xyg-search">
	  <div class="xyg-search-left" id="cityTab">
	  	<span id="cityShow" data-id="${currentCity.id}">${currentCity.name}</span><span><svg class="icon" aria-hidden="true"><use xlink:href="#iconzelvxuanzefeiyongdaosanjiaoxingfandui"></use></svg></span>
	  </div>
	  <div class="xyg-search-right">
	  	<div class="xyg-search-right-content">
	  		<div class="xyg-search-right-content-icon">
	  			<svg class="icon" aria-hidden="true">
                        <use xlink:href="#iconsousuo">
                        </use>
                    </svg>
	  		</div>
	  		<input type="text" placeholder="请输入楼盘名称" id="search" readonly />
	  		<div class="clearBoth"></div>
	  	</div>
	  </div>
	  <div class="clearBoth"></div>
  </div>
  <div class="xyg-index">
      <!--banner图开始-->
      <#if webBannerList??&&(webBannerList?size gt 0)>
      <div class="xyg-comp-banner swiper-container">
          <div class="swiper-wrapper">
              <#list webBannerList as webBanner>
                  <#if webBanner.url?? && webBanner.url!="">
                      <div onClick="window.location.href='${webBanner.url}'" class="swiper-slide"><img src="${webBanner.image}"/></div>
                      <#else>
                          <div  class="swiper-slide"><img src="${webBanner.image}"/></div>
                  </#if>
              </#list>
          </div>
          <div class="swiper-pagination xyg-comp-banner-swiper"></div>
      </div>
      </#if>
      <!--banner图结束-->
      <!--导航开始-->
      <div class="xyg-menu">
        <div class="xyg-menu-item">
           <a href="javascript:goFwPage('${memberId}','${currentCity.id}')">
            <div class="xyg-menu-item-pic">
                <img src="${s.base}/mobile/wechat/images/menu_1.png"/>
            </div>
            <div class="xyg-menu-item-title">
                 满福堂
            </div>
           </a>
        </div>
        <div class="xyg-menu-item">
          <!-- <a href="javascript:goWybbPage('${memberId}','${currentCity.id}')">-->
            <a href="javascript:goArticlePage('${memberId}','20190824211001030706058914689416')">
            <div class="xyg-menu-item-pic">
                <img src="${s.base}/mobile/wechat/images/menu_2.png"/>
            </div>
            <div class="xyg-menu-item-title">
                报备流程
            </div>
			</a>
        </div>
        <div class="xyg-menu-item">
           <a href="javascript:goKhPage('${memberId}')">
            <div class="xyg-menu-item-pic">
                <img src="${s.base}/mobile/wechat/images/menu_3.png"/>
            </div>
            <div class="xyg-menu-item-title">
                客户信息
            </div>
			</a>
        </div>
        <div class="xyg-menu-item">
            <a href="javascript:goJFDHPage('${memberId}')">
            <div class="xyg-menu-item-pic">
                <img src="${s.base}/mobile/wechat/images/menu_4.png"/>
            </div>
            <div class="xyg-menu-item-title">
                积分商城
            </div>
            </a>
        </div>
        <div class="clearBoth"></div>
      </div>
      <!--导航结束-->
	  <!--新闻动态-->
	  <div class="xyg-news borderTop">
	  	<div class="xyg-news-left borderRight">
	  		<img src="${s.base}/mobile/wechat/images/fsdt_icon.png"/>
	  	</div>
	  	<div class="xyg-news-right">
	  		<ul class="ul1" id="cyt-show-content-notice">
			</ul>
	  	</div>
	  	<div class="clearBoth"></div>
	  </div>
	  <!--新闻动态-->
	  <!--热卖产品开始-->
	  <div style="width: 100%; height: auto; background: #f3f3f3;">
	  	<!--标题开始-->
		<div class="xyg-comp-nav-1">
			<div class="xyg-comp-nav-1-title">
				<div class="xyg-comp-nav-1-title-content">
					热卖新房
				</div>
				<div class="xyg-comp-nav-1-title-desc" onclick="goFwPage('${memberId}','${currentCity.id}')">
					更多
					<span>
						<svg class="icon" aria-hidden="true">
							<use xlink:href="#iconxiangyou">
							</use>
						</svg>
					</span>
				</div>
				<div class="clearBoth">
				</div>
			</div>
			<div class="xyg-comp-nav-1-icon">
			</div>
		</div>
    <!--标题结束-->
    <!--内容开始-->
  <div class="xyg-rmxf-slider swiper-container">
     <div class="swiper-wrapper" id="rmxfContent">

    </div>
  </div>
  <!--内容结束-->
  <!-- 热卖产品结束 -->
  </div>
  <div style="width: 96%; height: auto; margin: 0px 2%; padding: 0.5rem 0px;">
  	<img src="${s.base}/mobile/wechat/images/fjzd.png" style="width: 100%; height: auto;"/>
  </div>
  <!--满福堂开始-->
    <div class="xyg-comp-nav-1">
        <div class="xyg-comp-nav-1-title">
            <div class="xyg-comp-nav-1-title-content">
                满福堂
            </div>
            <div class="xyg-comp-nav-1-title-desc">
                
            </div>
            <div class="clearBoth">
            </div>
        </div>
        <div class="xyg-comp-nav-1-icon">
        </div>
    </div>
    <!--课程内容开始-->
   <div class="xyg-tap">
       <#list hostTypeList as hostType>
           <div class="xyg-tap-item" onclick="changeHostType('${hostType.id}',this)">
               <#if hostType.id = currentHostType.id>
                   <img src="${s.base}/mobile/wechat/images/tap_select_active.png"/>
                   <#else>
                       <img src="${s.base}/mobile/wechat/images/tap_select.png"/>
               </#if>
               <div class="xyg-tap-item-title">${hostType.name}</div>
               <div class="xyg-tap-item-price">${hostType.description}</div>
           </div>
       </#list>
	   <div class="clearBoth"></div>
	</div>
    <div class="xyg-article">
    </div>
    <!--课程内容结束-->
  </div>
  <!--底部菜单开始-->
  <div style="width:100%; height:2.5rem;"></div>
     <div class="xyg-comp-bottom">
        	<div class="xyg-comp-bottom-item">
        	<a href="javascript:goFistPage('${memberId}')">
        		<img src="${s.base}/mobile/wechat/images/menu_icon_1_a.png"/>
        		<div class="xyg-comp-bottom-item-text select-text">首页</div>
				</a>
        	</div>
        	<div class="xyg-comp-bottom-item">
        	<a href="javascript:goKhPage('${memberId}')">
        		<img src="${s.base}/mobile/wechat/images/menu_icon_2.png"/>
        		<div class="xyg-comp-bottom-item-text">客户</div>
				</a>
        	</div>
        	<div class="xyg-comp-bottom-item">
        		<a href="javascript:goMyPage('${memberId}')">
        		<img src="${s.base}/mobile/wechat/images/menu_icon_4.png"/>
        		<div class="xyg-comp-bottom-item-text">我的</div>
        		</a>
        	</div>
        	<div class="clearBoth"></div>
        </div>
  </body>
  <script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
  <script src="${s.base}/mobile/base/js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
  <script src="${s.base}/mobile/base/js/jquery-weui.js" type="text/javascript" charset="utf-8"></script>
  <script src="${s.base}/mobile/base/js/swiper.js" type="text/javascript" charset="utf-8"></script>
  <script src="${s.base}/mobile/base/js/component.js?12323434323232323232" type="text/javascript" charset="utf-8"></script>
  <script src="${s.base}/mobile/wechat/fonts/iconfont.js"></script>
  <script src="${s.base}/mobile/wechat/js/window_port.js"></script>
  <script src="${s.base}/mobile/wechat/js/base.js?12322323232"></script>

  <!--js分享代码开始-->
  <input type="hidden" value="${jSTicketShareResponse.appid}" id="appid" />
  <input type="hidden" value="${jSTicketShareResponse.fxTitle}" id="fxTitle" />
  <input type="hidden" value="${jSTicketShareResponse.fxImgUrl}" id="fxImgUrl" />
  <input type="hidden" value="${jSTicketShareResponse.fxDesc}" id="fxDesc" />
  <input type="hidden" value="${jSTicketShareResponse.fxUrl}" id="fxUrl" />
  <input type="hidden" value="${jSTicketShareResponse.nonceStr}" id="nonceStr" />
  <input type="hidden" value="${jSTicketShareResponse.timestamp}" id="timestamp" />
  <input type="hidden" value="${jSTicketShareResponse.signature}" id="signature" />
  <script src="${s.base}/mobile/base/js/share.js"></script>

  <script type="text/javascript">
      var nickName='${webMember.nickName}';
      if(nickName==null||nickName==""){
          $.alert("请先授权信息",function () {
              goCheckPage('/mobile/wechat/images/logoicon.png','/weChat/index','','');
          });
      }
      var currentCityId='${currentCity.id}';
      var currentHostTypeId='${currentHostType.id}';
      var memberId='${memberId}';
      $(document).ready(function(e) {
          $("#search").bind("click",function () {
              goSearchPage('${memberId}',currentCityId);
          });
          initDate();
      });

      function initDate() {
          //初始化banner
          $.fn.initXygCompBanner();
          //初始化动态房产

          acceptXygArticleListByColId('20190703211137075075239588275494','-1',currentCityId,function (data) {
              var str='';
              data.forEach(function (item,key,mapObj) {
                  str+='<li onclick="goArticlePage(\'${memberId}\',\''+item.id+'\')" class="font-grade-one">'+item.title+'</li>';
              });
              $("#cyt-show-content-notice").html(str);
              $.fn.initXygCompNotice($("#cyt-show-content-notice"));
          });
          //初始化热卖新房
          initPageNum(5);
          initContentNum();
          $(".xyg-ppjjr-slider").swiper({
              slidesPerView: 'auto',
              spaceBetween: 10,
          });
          $("#cityTab").select({
              title: "切换城市",
              items: ${citySelect},
              onChange: function(d) {

              },
              onClose: function(d) {
                  if(d.data.length>0){
                      currentCityId=d.data.values;
                      goFistPage(memberId,currentCityId);
                  }
              },
          });
      }
      var selectUrl='${s.base}/mobile/wechat/images/tap_select_active.png';
      var baseUrl='${s.base}/mobile/wechat/images/tap_select.png';

      function changeHostType(id,obj) {
          currentHostTypeId=id;
          $(".xyg-tap").find("img").attr("src",baseUrl);
          $(obj).find("img").attr("src",selectUrl);
          pageNum = 1;
          $(".xyg-article").html("");
          if(isDestroy){
              initContentNum();
          }else{
              sendPost();
          }
      }

      /**
       * 初始化页面信息
       * @param cityId
       */
      function initPageNum(num) {
          $.fn.postMethod("/weChat/hotHost",{'cityId':currentCityId,'num':num},function (data) {
              var str='';
              data.forEach(function (item,key,mapObj) {
                  str+='<div class="swiper-slide">'+
                      '<div class="xyg-rmxf-slider-item" onclick="goXqPage(\''+memberId+'\',\''+item.id+'\')">'+
                      '<img src="'+item.coverImage+'" style="width: 100%; height: 100%;"/>';
                  if(item.tag!=null&&item.tag!=""&&item.tag!="null"){
                      var tags=item.tag.split(",");
                      str+='<div class="xyg-rmxf-slider-item-tag">'+tags[0]+'</div>';
                  }else{
                      str+='<div class="xyg-rmxf-slider-item-tag"></div>';
                  }
                    str+='<div class="xyg-rmxf-slider-item-content">'+
                      '<div class="xyg-rmxf-slider-item-title">'+item.name+'</div>'+
                      '<div class="xyg-rmxf-slider-item-desc">均价：'+item.price+'元/m2&nbsp;&nbsp;户型面积：'+item.minApartmentArea+'-'+item.maxApartmentArea+'m2</div>'+
                      '</div>'+
                      '</div>'+
                      '</div>';
              });
              $("#rmxfContent").html(str);
              $(".xyg-rmxf-slider").swiper({
                  slidesPerView: 'auto',
                  spaceBetween: 10,
              });
          });
      }
      var memberId='${memberId}';
      var pageNum = 0;
      var pageSize = 5;
      var loading = false;  //状态标记
      var isDestroy = false;  //状态标记
      /**
       * 初始化内容页面信息
       * @param cityId
       */
      function initContentNum() {
          isDestroy = false;
          $(document.body).infinite().on("infinite", function () {
              if (loading) return;
              loading = true;
              sendPost();
          });
      }

      function sendPost() {
          pageNum++;
          $.fn.postMethodAll("/weChat/hostItem/page",{'pageNum':pageNum,'pageSize':pageSize,'cityId':currentCityId,'hostType':currentHostTypeId},function (result) {
              if (result.data != null && result.data.length > 0) {
                  result.data.forEach(function (item,key,mapObj) {
                      var str='<div class="xyg-article-item borderBottom" onclick="goXqPage(\''+memberId+'\',\''+item.id+'\')">'+
                          '<div class="xyg-article-item-pic">'+
                          '<img src="'+item.coverImage+'" style="width: 96%; height: 100%;"/>'+
                          '</div>'+
                          '<div class="xyg-article-item-content">'+
                          '<div class="xyg-article-item-content-title font-grade-one">'+item.name+'</div>'+
                          '<div class="xyg-article-item-content-author">'+item.cityName+'-'+item.areaName+'<div style="float: right;">'+item.price+'元/m2</div></div>'+
                      '<div class="xyg-article-item-content-author">'+
                      item.minRooms+'-'+item.maxRooms+'室&nbsp;|&nbsp;'+item.minApartmentArea+'-'+item.maxApartmentArea+'m2<!--<div style="float: right;font-size: 16px; font-weight: bold; color: #ff6669;">125万</div>-->'+
                      '</div><div class="xyg-article-item-content-tag">';
                      if(item.tag!=null&&item.tag!=""&&item.tag!="null"){
                          var tags=item.tag.split(",");
                          for(var i=0;i<tags.length;i++){
                              str+='<div class="xyg-article-item-content-tag-title">'+tags[i]+'</div>';
                          }
                      }
                      str+='</div>'+
                      '<div class="xyg-article-item-content-user">';
                      var img="/image/avatar_default.jpg";
                      if(item.userLogo!=null&&item.userLogo!=""){
                          img=item.userLogo;
                      }
                      str+='<img src="'+img+'"/>&nbsp;'+item.userName+'发布楼盘信息</div>'+
                      '</div>'+
                      '<div class="clearBoth"></div>'+
                      '</div>';
                      $(".xyg-article").append(str);
                  });
                  loading = false;
                  if (!result.hasNextPage) {
                      $(document.body).destroyInfinite();
                      isDestroy=true;
                  }
              } else {
                  $(document.body).destroyInfinite();
                  isDestroy=true;
              }
          });
      }
  </script>
</html>

